package com.ysh.gsm;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Id;

@Embeddable
public class KpiCPK implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1915351453281098820L;
	
	private Date timeStamp;
	private int cellId;

	@Id	
	@Column(name = "time_stamp", nullable = false)
	public Date getTimeStamp() {
		return timeStamp;
	}
	
	@Id	
	@Column(name = "cell_id", nullable = false)
	public int getCellId() {
		return this.cellId;
	}
	

	public void setTimeStamp(Date timeStamp) {
		this.timeStamp = timeStamp;
	}

	public void setCellId(int cellId) {
		this.cellId = cellId;
	}
	public int hashCode() {
		 return Arrays.hashCode(new Object[] {
				 timeStamp, cellId
			    });
	}

	public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}
		if (!(obj instanceof KpiCPK)) {
			return false;
		}
		if (null == obj) {
			return false;
		}
		KpiCPK pk = (KpiCPK) obj;
		return (pk.timeStamp ==timeStamp  && pk.cellId == cellId);
	}
	public KpiCPK(){
		super();
	}
	

}
